using System;
using System.Collections.Generic;
using System.Text;
using ACS.Compiler.Tree;
using ACS.Compiler.Util;

namespace ACS.Compiler.Tables.Modes
{
    public abstract class ContainerMode : Mode
    {
        public abstract StructMode Mode
        {
            get;
        }

        public Mode ResolveField(string field, TreeBase tree)
        {
            foreach (Field f in Mode.Fields)
            {
                if (f.FieldName == field)
                {
                    return f.FieldMode;
                }
            }
            Logger.Instance.TraceError(String.Format("Field {0} not found in type {1}", field, this), tree);
            return null;
        }


    }
}
